<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
   <meta charset="utf-8" />
   <title>利导科技客户关系管理系统  | 首页</title>
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
   <meta content="width=device-width, initial-scale=1.0" name="viewport" />
   <meta name="MobileOptimized" content="320">
   <!-- BEGIN GLOBAL MANDATORY STYLES -->          
   <link href="${base}/assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
   <link href="${base}/assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
   <link href="${base}/assets/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css"/>
   <!-- END GLOBAL MANDATORY STYLES -->
   <!-- BEGIN THEME STYLES --> 
   <link href="${base}/assets/css/style-metronic.css" rel="stylesheet" type="text/css"/>
   <link href="${base}/assets/css/style.css" rel="stylesheet" type="text/css"/>
   <link href="${base}/assets/css/style-responsive.css" rel="stylesheet" type="text/css"/>
   <link href="${base}/assets/css/plugins.css" rel="stylesheet" type="text/css"/>
   <link href="${base}/assets/css/pages/tasks.css" rel="stylesheet" type="text/css"/>
   <link href="${base}/assets/css/themes/default.css" rel="stylesheet" type="text/css" id="style_color"/>
   <link href="${base}/assets/css/custom.css" rel="stylesheet" type="text/css"/>
   <!-- END THEME STYLES -->
   <link rel="shortcut icon" href="${base}/assets/img/favicon.ico" />
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed">
   <#include "header.ftl">
   <div class="clearfix"></div>
   <!-- BEGIN CONTAINER -->
   <div class="page-container">
   	  <!-- 系统主目录 -->
      <!-- BEGIN SIDEBAR -->
      <#include "main_menu.ftl">
      <!-- END SIDEBAR -->
      <!-- BEGIN PAGE -->
      <div class="page-content">
      	 <!-- 员工密码修改 -->
      	 <#include "changePassword.ftl">
         <#include "system-set.ftl">
         <!-- 显示某条公告的具体内容-->
			 <div class="modal fade" id="Announcement" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			    <div class="modal-dialog">
			       <div class="modal-content">
			          <div class="modal-header">
			             <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
			             <h4 class="modal-title">系统公告</h4>
			          </div>
			          <div class="modal-body">
			             <div style = "text-align:center"><span id = "Title"></span></div><br />
						<div style = "text-align:center">
							浏览次数：<span id = "Amount" style = "margin-right:10px;"></span>
							发布时间：<span id = "PublishTime"></span>
						</div><br />
						<div><span id = "Content"></span></div>
			          </div>
			          <div class="modal-footer">
			             <button type="button" class="btn default" data-dismiss="modal">关闭</button>
			          </div>
			       </div>
			       <!-- /.modal-content -->
			    </div>
			    <!-- /.modal-dialog -->
			 </div>
			<!-- /.modal -->
		 <!-- 显示某条公告的具体内容-->
         <!-- BEGIN PAGE HEADER-->
         <div class="row">
            <div class="col-md-12">
               <!-- BEGIN PAGE TITLE & BREADCRUMB-->
               <ul class="page-breadcrumb breadcrumb">
                  <li>
                     <i class="icon-home"></i>
                     <a href="${base}/admin/admin!main.action">Home</a> 
                  </li>
               </ul>
               <!-- END PAGE TITLE & BREADCRUMB-->
            </div>
         </div>
         <!-- END PAGE HEADER-->
         <!-- BEGIN DASHBOARD STATS -->
         <div class="row">
            <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
               <div class="dashboard-stat blue">
                  <div class="visual">
                     <i class="icon-edit"></i>
                  </div>
                   <div class="details">
                     <div class="number">
                        	新建客户
                     </div>
					 <div class="desc">快速建立你的客户信息</div>
                  </div>
                  <a class="more" href="${base}/admin/customer!add.action">
                  	Do it <i class="m-icon-swapright m-icon-white"></i>
                  </a>      
               </div>
            </div>
            <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
               <div class="dashboard-stat green">
                  <div class="visual">
                     <i class="icon-pencil"></i>
                  </div>
                  <div class="details">
                     <div class="number">新建订单</div>
                     <div class="desc">快速建立订单信息</div>
                  </div>
                  <a class="more" href="${base}/admin/order!add.action">
                  do it <i class="m-icon-swapright m-icon-white"></i>
                  </a>                 
               </div>
            </div>
            <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
               <div class="dashboard-stat purple">
                  <div class="visual">
                     <i class="icon-briefcase"></i>
                  </div>
                  <div class="details">
                     <div class="number">新建合同</div>
                     <div class="desc">快速建立信息</div>
                  </div>
                  <a class="more" href="${base}/admin/contact!add.action">
                  do it <i class="m-icon-swapright m-icon-white"></i>
                  </a>                 
               </div>
            </div>
            <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
               <div class="dashboard-stat yellow">
                  <div class="visual">
                     <i class="icon-bar-chart"></i>
                  </div>
                   <div class="details">
                     <div class="number">￥<#if myTotalProfit?exists>${myTotalProfit}<#else>0.00</#if></div>
                     <div class="desc">我的合同总金额</div>
                  </div>
                  <a class="more" href="${base}/admin/contract!myContract.action">
                  view detail <i class="m-icon-swapright m-icon-white"></i>
                  </a>                 
               </div>
            </div>
         </div>
         <!-- END DASHBOARD STATS -->
         <div class="row">
            <div class="col-md-6 col-sm-6">
               <!-- BEGIN PORTLET-->
               <div class="portlet solid bordered light-grey">
                  <div class="portlet-title">
                     <div class="caption"><i class="icon-bar-chart"></i>月度业绩走势<span style = "font-size:12px;">(本年度所有月份)</span></div>
                  </div>
                  <div class="portlet-body">
                     <div id="site_statistics_loading">
                        <img src="${base}/assets/img/loading.gif" alt="loading"/>
                     </div>
                     <div id="site_statistics_content" class="display-none">
                        <div id="site_statistics" class="chart"></div>
                     </div>
                  </div>
               </div>
               <!-- END PORTLET-->
            </div>
            <div class="col-md-6 col-sm-6">
            	<!-- BEGIN PORTLET-->
               <div class="portlet solid bordered light-grey">
                  <div class="portlet-title">
                     <div class="caption"><i class="icon-bar-chart"></i>目标完成情况<span style = "font-size:12px;">(最近6个月)</span></div>
                  </div>
                  <div class="tools">
                        <div class="btn-group pull-right" data-toggle="buttons">
                           	目标量<a href="" class="btn btn-sm" style = "background-color:#d12610;"></a><br />
                           	完成量<a href="" class="btn btn-sm" style = "background-color:#37b7f3;"></a>
                        </div>
                     </div>
                  <div class="portlet-body">
                     <div id="site_statistics_contents">
                        <canvas id="canvas" height="300" width="560"></canvas>
                     </div>
                  </div>
               </div>
               <!-- END PORTLET-->
            </div>
            
         <div class="clearfix"></div>
         <div class="row ">
            <div class="col-md-6 col-sm-6">
               <div class="portlet box blue">
                  <div class="portlet-title">
                     <div class="caption"><i class="icon-bell"></i>系统公告</div>
                     <div class="tools">
                     	<a href="javascript:;" class="collapse"></a>
                        <a href="" class="reload"></a>
                     </div>
                  </div>
                  <div class="portlet-body">
                     <div class="scroller" style="height: 300px;" data-always-visible="1" data-rail-visible="0">
                        <ul class="feeds">
                        	<#if announcementList?exists>
                        		<#list announcementList as announcement>
		                           <li>
		                              <a href="javascript:;" onclick = "findAnnouncementById(${announcement.id})">
		                                 <div class="col1">
		                                    <div class="cont">
		                                       <div class="cont-col1">
		                                          <div class="label label-sm label-success">                        
		                                             <i class="icon-bell-alt"></i>
		                                          </div>
		                                       </div>
		                                       <div class="cont-col2">
		                                          <div class="desc">
		                                            	 ${announcement.title}
		                                          </div>
		                                       </div>
		                                    </div>
		                                 </div>
		                                 <div class="col2">
		                                    <div class="date">
		                                        ${announcement.timeDifference}
		                                    </div>
		                                 </div>
		                              </a>
		                           </li>
		                           <#if announcement_index+1 == 9>
										<#break>
									</#if>
		                       </#list>      
		                    </#if>       
                        </ul>
                     </div>
                     <div class="scroller-footer">
                        <div class="pull-right">
                           <a href="${base}/admin/announcement!list.action">更多<i class="m-icon-swapright m-icon-gray"></i></a> &nbsp;
                        </div>
                     </div>
                  </div>
               </div>
            </div>
            
            <div class="col-md-6 col-sm-6">
               <div class="portlet box green tasks-widget">
                  <div class="portlet-title">
                     <div class="caption"><i class="icon-bar-chart"></i>当日统计</div>
                     <div class="tools">
                     	<a href="javascript:;" class="collapse"></a>
                        <a href="" class="reload"></a>
                     </div>
                  </div>
                  <div class="portlet-body">
                     <div class="task-content">
                        <div class="scroller" style="height: 305px;" data-always-visible="1" data-rail-visible1="1">
                           <!-- START TASK LIST -->
                           <ul class="task-list">
                              <li>
                                 <span class="task-title-sp">新增 <a href = "#" style = "color:red;"><#if appendedMembers?exists>${appendedMembers}<#else>0</#if></a> 个客户</span> 
                              </li>
                              <li>
                                 <span class="task-title-sp">有 <a href = "#" style = "color:red;"><#if birthdayMembers?exists>${birthdayMembers}<#else>0</#if></a> 个客户签单</span> 
                              </li>
                              <li>
                                 <span class="task-title-sp">签单合同金额 <a href = "#" style = "color:red;"> <#if sum?exists>${sum}<#else>0.00</#if> </a>元</span> 
                              </li>
                              
                              <li>
                                 <span class="task-title-sp">库存总剩余 <a href = "#" style = "color:red;"><#if repertory?exists>${repertory}<#else>0</#if></a> 件</span> 
                              </li>
                              <li>
                                 <span class="task-title-sp">消耗库存 <a href = "#" style = "color:red;"><#if appendedMedicines?exists>${appendedMedicines}<#else>0</#if></a> </span> 
                              </li>
                              <li>
                                 <span class="task-title-sp">新增 <a href = "#" style = "color:red;"><#if appendedSuppliers?exists>${appendedSuppliers}<#else>0</#if></a> 个供应商</span> 
                              </li>
                           </ul>
                           <!-- END START TASK LIST -->
                        </div>
                     </div>
                     <div class="task-footer">
                        <span class="pull-right">
                        <a href="#">详细 <i class="m-icon-swapright m-icon-gray"></i></a> &nbsp;
                        </span>
                     </div>
                  </div>
               </div>
            </div>
         </div>
      </div>
      <!-- END PAGE -->
   </div>
   <!-- END CONTAINER -->
   <#include "footer.ftl">
   <!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
   <#include "coreJsPlugins.ftl">
   <!-- BEGIN PAGE LEVEL PLUGINS -->
   <script src="${base}/assets/plugins/jqvmap/jqvmap/jquery.vmap.js" type="text/javascript"></script>   
   <script src="${base}/assets/plugins/jqvmap/jqvmap/maps/jquery.vmap.russia.js" type="text/javascript"></script>
   <script src="${base}/assets/plugins/jqvmap/jqvmap/maps/jquery.vmap.world.js" type="text/javascript"></script>
   <script src="${base}/assets/plugins/jqvmap/jqvmap/maps/jquery.vmap.europe.js" type="text/javascript"></script>
   <script src="${base}/assets/plugins/jqvmap/jqvmap/maps/jquery.vmap.germany.js" type="text/javascript"></script>
   <script src="${base}/assets/plugins/jqvmap/jqvmap/maps/jquery.vmap.usa.js" type="text/javascript"></script>
   <script src="${base}/assets/plugins/jqvmap/jqvmap/data/jquery.vmap.sampledata.js" type="text/javascript"></script>  
   <script src="${base}/assets/plugins/flot/jquery.flot.js" type="text/javascript"></script>
   <script src="${base}/assets/plugins/flot/jquery.flot.resize.js" type="text/javascript"></script>
   <script src="${base}/assets/plugins/jquery.pulsate.min.js" type="text/javascript"></script>
   <script src="${base}/assets/plugins/bootstrap-daterangepicker/moment.min.js" type="text/javascript"></script>
   <script src="${base}/assets/plugins/bootstrap-daterangepicker/daterangepicker.js" type="text/javascript"></script>     
   <script src="${base}/assets/plugins/gritter/js/jquery.gritter.js" type="text/javascript"></script>
   <!-- IMPORTANT! fullcalendar depends on jquery-ui-1.10.3.custom.min.js for drag & drop support -->
   <script src="${base}/assets/plugins/fullcalendar/fullcalendar/fullcalendar.min.js" type="text/javascript"></script>
   <script src="${base}/assets/plugins/jquery-easy-pie-chart/jquery.easy-pie-chart.js" type="text/javascript"></script>
   <script src="${base}/assets/plugins/jquery.sparkline.min.js" type="text/javascript"></script>  
   <script src="${base}/resources/scripts/Chart.js" type="text/javascript"></script>
   <!-- END PAGE LEVEL PLUGINS -->
   
   <!-- BEGIN PAGE LEVEL SCRIPTS -->
   <script src="${base}/assets/scripts/app.js" type="text/javascript"></script>
   <script src="${base}/resources/scripts/main.js" type="text/javascript"></script>
   <!-- END PAGE LEVEL SCRIPTS -->  
   <script>
      jQuery(document).ready(function() {    
         App.init(); // initlayout and core plugins
         Index.init();
         Index.initCharts();
         Index.initMiniCharts();
      });
      
      function findAnnouncementById(id){
      	$.ajax({
            type:"post",
            url:"/pims/admin/announcement!findById.action",
            dataType:"json",
            data:"id="+id,
            cache:false,
            beforeSend:function(XMLHttpRequest){
            },
            success:function(json){
            	result = json.success;
            	announcement = json.announcement;
            	if(result){
            		$("#Title").html(announcement.title);
            		$("#PublishTime").html(announcement.time);
            		$("#Content").html(announcement.content);
            		$("#Amount").html(announcement.llcs);
            		$('#Announcement').modal('show');
            	}
            },
           	complete:function(XMLHttpRequest,textStatus){
           	},
          	error:function(XMLHttpRequest,textStatus,errorThrown){
                   alert("网络错误，请稍后重试");
          	}
        });
      }
   </script>
   <script>

		var barChartData = {
			labels : ["1月","2月","3月","4月","5月","6月","7月"],
			datasets : [
				{
					fillColor : "rgba(177,38,16,0.5)",
					strokeColor : "rgba(177,38,16,1)",
					data : [3000,4000,6000,8000,12000,13000,15000]
				},
				{
					fillColor : "rgba(55,183,243,0.5)",
					strokeColor : "rgba(55,183,243,1)",
					data : [2600,3200,5400,7600,13008,14006,11100]
				}
			]
			
		}

	var myBar = new Chart(document.getElementById("canvas").getContext("2d")).Bar(barChartData);
	
	
	</script>
   <!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>